package com.xiaolun;

/**
 * @Author 硕鼠
 * @Date 2020/5/30 15:09
 * @Version 1.0
 * @Description 文件说明
 */
public class Demo07 {
	public static void main(String[] args) {
		printMax(35, 8, 9, 56, 9);
	}

	public static void printMax(double... numbers) { //可变参数
		if (numbers.length == 0) {
			System.out.println("No argument passed");
		}
		double result = numbers[0];

		//排序
		for (int i = 1; i < numbers.length; i++) {
			if (numbers[i] > result) {
				result = numbers[i];
			}
		}
		System.out.println("The Max value is:" + result);
	}
}
